Representation of multivariate domains

({{ , Topology, 2D, 3D}, {Domain givem by one implicit equation 
(=), Boundary, ContourPlot
D≡{(x^2)+(y^2)=1, ContourPlot3D
D≡{(x^2)+(y^2)+(z^2)=1}, {Domain givem by one or more implicit inequalities 
(<,<=), Interior, RegionPlot
D≡(Piecewise[{{(x^2)+(y^2)<=1}, {x+y>0}}]), RegionPlot3D
D≡{(x^2)+(y^2)+(z^2)<=1}})

Example 1

D≡{(x^2)+(y^2)=1

As we have two variables we know that it is a domain in (ℝ^2) and we use ContourPlot.

ContourPlot[(x^2)+(y^2)==1,{x,-1,1},{y,-1,1},Axes->True,Frame->False]

Example 2

D≡{(x^2)+(y^2)<1

Again we have two variables so D is a domain in the plane defined by inequalities and we use RegionPlot

RegionPlot[(x^2)+(y^2)<1,{x,-1,1},{y,-1,1},Axes->True,Frame->False]

Example 3

D≡(Piecewise[{{(x^2)+(y^2)<=1}, {x+y>0}}])

graphicinterior=RegionPlot[(x^2)+(y^2)<=1&&x+y>0,{x,-1,1},{y,-1,1},Axes->True,Frame->False,PlotPoints->40]

We can display in the same graphic two boundary type domains (defined by an identity, =). To representthe domains  (Subscript[D, 1])≡{(x^2)+(y^2)=1  and  (Subscript[D, 2])≡{x+y=1 , inside ContourPlot we group both equations with curly braces and separated by comma.

graphicboundary=ContourPlot[{(x^2)+(y^2)==1,x+y==0},{x,-1,1},{y,-1,1},Axes->True,Frame->False,PlotPoints->40]

As we gave a name to the last two graphics (graphicsinterior, graphicboundary), now we can combine them by means of the instrucion Show.

Show[{graphicinterior,graphicboundary}]

Example 4

D≡{(x^3)+(y^2)<=1

RegionPlot[(x^3)+(y^2)<=1,{x,-10,10},{y,-20,20}]

Example 5

D≡(Piecewise[{{3(x^2)+5(y^2)<=4}, {2x+y>0}}])

RegionPlot[3(x^2)+5(y^2)<=4&&2x+y>=0,{x,-2,2},{y,-2,2},Frame->False,Axes->True]

It is difficult to represent in an exact manner the boundary of this domain since it consists of a part of the boundary domain coming from the first equation , (Subscript[D, 1])≡{3(x^2)+5(y^2)=4, and a part of the boundary domain defined by the second equation, (Subscript[D, 2])≡{2x+y=0. What we can do is to represent in the same graphic both boundary domains, (Subscript[D, 1]) and (Subscript[D, 2]).

ContourPlot[{3(x^2)+5(y^2)==4,2x+y==0},{x,-2,2},{y,-2,2},Frame->False,Axes->True]

Example 6

D≡{(x^2)+(y^2)+(z^2)<=1

In this case we have three variables so D is a domain of the space, (ℝ^3), defined by an inequalito so we use RegionPlot3D.

RegionPlot3D[(x^2)+(y^2)+(z^2)<=1,{x,-1,1},{y,-1,1},{z,-1,1}]

As we can see D≡{(x^2)+(y^2)+(z^2)<=1  is the closed ball of the space centered at the origin and with radious 1. The boundary of D would be ∂D≡{(x^2)+(y^2)+(z^2)=1 but as it is a closed surface we cannot distinguish the graphic of D and ∂D.

ContourPlot3D[(x^2)+(y^2)+(z^2)==1,{x,-1,1},{y,-1,1},{z,-1,1}]

Example 7

D≡(Piecewise[{{(x^2)+(y^2)+(z^2)<=1}, {(x^2)+(y^2)>=z}}])

domainD=RegionPlot3D[(x^2)+(y^2)+(z^2)<=1&&(x^2)+(y^2)>=z,{x,-1,1},{y,-1,1},{z,-1,1},PlotPoints->40]

As it can be seen, even for Mathematica to represent this domain is a difficult problem and we need to ask for higher precission by means of the option PlotPoints->40.

To have an idea about why the we obtain such representation we have to realize that D is the intersection of (Subscript[D, 1])≡{(x^2)+(y^2)+(z^2)<=1  which is the closed ball or radious 1 centered at the origin  and  (Subscript[D, 2])≡{(x^2)+(y^2)>=z. The boundary of (Subscript[D, 2]) is  ∂(Subscript[D, 2])≡{(x^2)+(y^2)=z  which is the elliptical paraboloid that can be displayd with ContourPlot3D.

boundaryD2=ContourPlot3D[(x^2)+(y^2)==z,{x,-1,1},{y,-1,1},{z,-1,1}]

(Subscript[D, 2 ])is the domain under this paraboloid and, therefore, D is the part of the ball under such a paraboloid. As we put names to every image we can combine both of them with Show.

Show[{domainD,boundaryD2}]

Example 8

D≡{(x^2)(e^x)+(y^2)(e^y)+(z^2)(e^z)=1

ContourPlot3D[(x^2)(E^x)+(y^2)(E^y)+(z^2)(E^z)==1,{x,-15,1},{y,-15,1},{z,-15,1},Axes->True]

Some important equations:

({{(ℝ^2) (real plane), }, {Circunference with radius r centered at p=((Subscript[x, 0]),(Subscript[y, 0])), D≡{(((x-(Subscript[x, 0])))^2)+(((y-(Subscript[y, 0])))^2)=(r^2)}, {Elipse with semi-radius a,b centered at p=((Subscript[x, 0]),(Subscript[y, 0])), D≡{(((((x-(Subscript[x, 0]))/a)))^2)+(((((y-(Subscript[y, 0]))/b)))^2)=1}, {Line passing through p=((Subscript[x, 0]),(Subscript[y, 0])) in the direction of
v=(a,b), D≡{(((x-(Subscript[x, 0]))/a))-(((y-(Subscript[y, 0]))/b))=0}, {General line with normal vector v=(A,B), D≡{A x+B y=C}, {General semiplane, D≡{A x+B y({{<}, {<=}, {>}, {>=}})C}})

({{(ℝ^3) (real space), }, {Sphere with radius r centered at p=((Subscript[x, 0]),(Subscript[y, 0]),(Subscript[z, 0])), D≡{(((x-(Subscript[x, 0])))^2)+(((y-(Subscript[y, 0])))^2)+(((z-(Subscript[z, 0])))^2)=(r^2)}, {Ellipsoid with semi-radius a,b,c centered at 
p=((Subscript[x, 0]),(Subscript[y, 0]),(Subscript[z, 0]))(ℝ^2), D≡{(((((x-(Subscript[x, 0]))/a)))^2)+(((((y-(Subscript[y, 0]))/b)))^2)+(((((z-(Subscript[yz, 0]))/c)))^2)=1}, {Plane passing through p=((Subscript[x, 0]),(Subscript[y, 0])) with normal vector
v=(a,b,c), D≡{a(x-(Subscript[x, 0]))-b(y-(Subscript[y, 0]))+c(z-(Subscript[z, 0]))=0}, {General plane with normal vector v=(A,B,C), D≡{A x+B y+C z=D}, {General semi-space, D≡{A x+B y+C z({{<}, {<=}, {>}, {>=}})D}})

Definition of multivariate functions

To define a real function with several variables we use similar notation to the one for one variable. For instance to define the function

f(x,y,z)=(x^2)+(y^2)+Cos[x y z]

we write in Mathematica:

f[x_,y_,z_]:=(x^2)+(y^2)+Cos[x y z]

To define a real function with several variables we use similar notation to the one for one variable. For instance to define the function
To define a vectorial multivariate function we have to recall that to represent a vector with Mathematica we use curly braces. Therefore, the vector v=(2,-1,1) is represented in Mathematica by {2,-1,1}
Thus, the function

({{f:(ℝ^2)⟶(ℝ^3)}, {f(x,y)=(x+y,(x^2)-y,(x^2)+(y^3))}})

we write:

f[x_,y_]:={x+y,(x^2)-y,(x^2)+(y^3)}

Thus, a curve, which is a vectorial curve with one variable is defined in much the same way. For instance, the helix

({{c:[0,5π]⊆ℝ⟶(ℝ^3)}, {c(t)=(cos(t),sin(t),t)}})

can be defined in Mathematica by

c[t_]:={Cos[t],Sin[t],t}

Representation of multivariate functions

Representation of a real function of two variables, f:D⊆(ℝ^2)⟶ℝ as a graph

The only case of multivariate function that can be represented (as a graph of a function) is the one of  real functions of two variables, f:(ℝ^2)->ℝ, that can be dispalyed in the space by meand of the instruction Plot3D

Example 9

({{f:[-5,5]×[-5,5]⊆(ℝ^2)->ℝ}, {f(x,y)=(x^2)y+(x^2)-y}})

Plot3D[(x^2)y+(x^2)-y,{x,-5,5},{y,-5,5}]

In order to display the most “interesting” part of the function Mathematica sometimes truncates de representation in order to keep in the image the main features. In this case we can see that Mathematica truncated the range of values plotted for f(x,y) between -50 and 50. We can ask Mathematica not to apply such a truncation by means of the option PlotRange->All.

Plot3D[(x^2)y+(x^2)-y,{x,-5,5},{y,-5,5},PlotRange->All]

Example 9

({{f:[-1,1]×[-1,1]->(ℝ^2)}, {f(x,y)=(((x^2)y)/((x^4)+(y^2)))}})

In Plot3D we can insert the complete formula for the function as we did in the example before but if we define the function in advance it is not necessary to copy again the formula as Mathematica will remember the definition.

f[x_,y_]:=(((x^2)y)/((x^4)+(y^2)))

Plot3D[f[x,y],{x,-1,1},{y,-1,1},PlotPoints->50]

Representation of a curve (vectorial function of one variable, C:I⊆ℝ⟶(ℝ^n) )

A vectorial function with one varible can be considered as describing the position of a point in the plane, space, etc. along the time. In other words, we consider the variable of the curve as a parameter representing the time. In that case, the instruction to obtaing the graphic of the path followed by the point is ParametricPlot in the plane and ParametricPlot3D in the space.

Example 10

Represent the curve ({{c:[0,5π]⊆ℝ⟶(ℝ^2)}, {c(t)=(t cos(t),t sin(t))}})

ParametricPlot[{t Cos[t],t Sin[t]},{t,0,5π}]

Example 11

If we defined the curve in Mathematica before, as for any other function, we can use the definition to obtain the graphic without copying the formula again.

c[t_]:={Cos[t],Sin[t],t}

ParametricPlot3D[c[t],{t,0,5π}]

Example 12

Represent the curve ({{c:[0,5π]⊆ℝ⟶(ℝ^2)}, {c(t)=(t cos(t),t sin(t),t)}})

ParametricPlot3D[{t Cos[t],t Sin[t],t},{t,0,5π}]